// app/middleware/auth.js
module.exports = () => {
    return async function auth(ctx, next) {
        await next();
        const is_has = ctx.get('x-auth');
        if (!is_has) {
            ctx.status = 304
            ctx.body = { error: 'Not Authrized' };
        }
    };
};